package great.easychat.help.util;

import android.content.Context;
import android.os.Handler;
import android.widget.Toast;

/**
 * Created by Administrator on 2019/02/17 0017.
 */

public class ToastUtil {

    static Toast toast;
    static Context mContext;
    static Handler handler = new Handler();

    public static void init(Context context) {
        ToastUtil.mContext = context;
        toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    }

    public static void show(final String msg) {
        handler.post(new Runnable() {
            @Override
            public void run() {
                toast.setText(msg);
                toast.show();
            }
        });
    }


}
